<template>
  <el-form-item label="上级栏目">
    <el-tree-select v-model="editorForm.parentCategory.value" placeholder="选择展示栏目" :data="allCategory" :props="selectProps" default-expand-all check-strictly style="width: 100%" @change="backUpdate" />
  </el-form-item>
</template>

<script setup>
import { reactive, inject, computed } from 'vue'
import { useStore } from 'vuex'

const store = useStore()
const { editorForm, backUpdate } = inject('commonForm')
const allCategory = computed(() => store.state.category.categoryTree)
const selectProps = reactive({
  children: 'children',
  label: 'name',
  value: 'id',
  disabled: (data) => {
    return data.state === 1
  }
})
</script>

<style lang='scss' scoped>

</style>